|
ambient25 2.2.0
|
API for configuring and manipulating Ambient 25 Click driver. More...
Topics | |
| Ambient 25 Registers List | |
| List of registers of Ambient 25 Click driver. | |
| Ambient 25 Registers Settings | |
| Settings for registers of Ambient 25 Click driver. | |
| Ambient 25 MikroBUS Map | |
| MikroBUS pin mapping of Ambient 25 Click driver. | |
Functions | |
| void | ambient25_cfg_setup (ambient25_cfg_t *cfg) |
| Ambient 25 configuration object setup function. | |
| err_t | ambient25_init (ambient25_t *ctx, ambient25_cfg_t *cfg) |
| Ambient 25 initialization function. | |
| err_t | ambient25_default_cfg (ambient25_t *ctx) |
| Ambient 25 default configuration function. | |
| err_t | ambient25_write_regs (ambient25_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
| Ambient 25 write regs function. | |
| err_t | ambient25_read_regs (ambient25_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
| Ambient 25 read regs function. | |
| err_t | ambient25_write_reg (ambient25_t *ctx, uint8_t reg, uint8_t data_in) |
| Ambient 25 write reg function. | |
| err_t | ambient25_read_reg (ambient25_t *ctx, uint8_t reg, uint8_t *data_out) |
| Ambient 25 read reg function. | |
| err_t | ambient25_write_reg_word (ambient25_t *ctx, uint8_t reg, uint16_t data_in) |
| Ambient 25 write reg word function. | |
| err_t | ambient25_read_reg_word (ambient25_t *ctx, uint8_t reg, uint16_t *data_out) |
| Ambient 25 read reg word function. | |
| err_t | ambient25_check_communication (ambient25_t *ctx) |
| Ambient 25 check communication function. | |
| void | ambient25_enable_device (ambient25_t *ctx) |
| Ambient 25 enable device function. | |
| void | ambient25_disable_device (ambient25_t *ctx) |
| Ambient 25 disable device function. | |
| void | ambient25_set_vsync_pin (ambient25_t *ctx, uint8_t state) |
| Ambient 25 set vsync pin state function. | |
| uint8_t | ambient25_get_int_pin (ambient25_t *ctx) |
| Ambient 25 get int pin state function. | |
| err_t | ambient25_soft_reset (ambient25_t *ctx) |
| Ambient 25 soft reset function. | |
| err_t | ambient25_clear_fifo (ambient25_t *ctx) |
| Ambient 25 clear fifo function. | |
| err_t | ambient25_read_fifo_size (ambient25_t *ctx, uint16_t *fifo_size) |
| Ambient 25 read fifo size function. | |
| err_t | ambient25_read_data (ambient25_t *ctx, ambient25_data_t *data_out) |
| Ambient 25 read data function. | |
API for configuring and manipulating Ambient 25 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void ambient25_cfg_setup | ( | ambient25_cfg_t * | cfg | ) |
Ambient 25 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See ambient25_cfg_t object definition for detailed explanation. |
| err_t ambient25_check_communication | ( | ambient25_t * | ctx | ) |
Ambient 25 check communication function.
This function checks the communication by reading and verifying the device ID.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t ambient25_clear_fifo | ( | ambient25_t * | ctx | ) |
Ambient 25 clear fifo function.
This function clears the FIFO buffers and interrupts.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t ambient25_default_cfg | ( | ambient25_t * | ctx | ) |
Ambient 25 default configuration function.
This function executes a default configuration of Ambient 25 Click board.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void ambient25_disable_device | ( | ambient25_t * | ctx | ) |
Ambient 25 disable device function.
This function enables the device by setting the EN pin to LOW logic state.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
| void ambient25_enable_device | ( | ambient25_t * | ctx | ) |
Ambient 25 enable device function.
This function enables the device by setting the EN pin to HIGH logic state.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
| uint8_t ambient25_get_int_pin | ( | ambient25_t * | ctx | ) |
Ambient 25 get int pin state function.
This function returns the INT pin logic state.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
| err_t ambient25_init | ( | ambient25_t * | ctx, |
| ambient25_cfg_t * | cfg ) |
Ambient 25 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See ambient25_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t ambient25_read_data | ( | ambient25_t * | ctx, |
| ambient25_data_t * | data_out ) |
Ambient 25 read data function.
This function checks if the als measurement data are ready for all channels and reads them.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
| [out] | data_out | : ALS measurements data object. See ambient25_data_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t ambient25_read_fifo_size | ( | ambient25_t * | ctx, |
| uint16_t * | fifo_size ) |
Ambient 25 read fifo size function.
This function reads the number of data bytes available to read from FIFO.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
| [out] | fifo_size | : Number of data bytes available to read from FIFO. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t ambient25_read_reg | ( | ambient25_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out ) |
Ambient 25 read reg function.
This function reads data from the selected register by using I2C serial interface.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Output read data. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t ambient25_read_reg_word | ( | ambient25_t * | ctx, |
| uint8_t | reg, | ||
| uint16_t * | data_out ) |
Ambient 25 read reg word function.
This function reads a data word starting from the selected register by using I2C serial interface.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
| [in] | reg | : Start register address. |
| [out] | data_out | : Output read data word. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t ambient25_read_regs | ( | ambient25_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out, | ||
| uint8_t | len ) |
Ambient 25 read regs function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
| [in] | reg | : Start register address. |
| [out] | data_out | : Output read data. |
| [in] | len | : Number of bytes to be read. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void ambient25_set_vsync_pin | ( | ambient25_t * | ctx, |
| uint8_t | state ) |
Ambient 25 set vsync pin state function.
This function sets the VSYNC pin state.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
| [in] | state | : Pin logic state. |
| err_t ambient25_soft_reset | ( | ambient25_t * | ctx | ) |
Ambient 25 soft reset function.
This function executes the defice software reset command.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t ambient25_write_reg | ( | ambient25_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t | data_in ) |
Ambient 25 write reg function.
This function writes a desired data to the selected register by using I2C serial interface.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Data to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t ambient25_write_reg_word | ( | ambient25_t * | ctx, |
| uint8_t | reg, | ||
| uint16_t | data_in ) |
Ambient 25 write reg word function.
This function writes a data word starting from the selected register by using I2C serial interface.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
| [in] | reg | : Start register address. |
| [in] | data_in | : Data word to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t ambient25_write_regs | ( | ambient25_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_in, | ||
| uint8_t | len ) |
Ambient 25 write regs function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
| [in] | ctx | : Click context object. See ambient25_t object definition for detailed explanation. |
| [in] | reg | : Start register address. |
| [in] | data_in | : Data to be written. |
| [in] | len | : Number of bytes to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.